home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
misc
/
emu
/
Apex-src.lha
/
GRAPHICS.DOC
< prev
next >
Wrap
Text File
|
2001-09-30
|
7KB
|
173 lines
GRAPHICS.DOC JAN-02-88
XPL AMIGA GRAPHICS
40. CLEAR
This intrinsic clears the currently defined bit-map by setting all pixels
to zero. It is normally used to erase a bit-map before drawing on it or
displaying it. (See 108. BITMAP.)
The CLEAR intrinsic will appear to run as much as twice as fast if it is
not immediately followed by a LINE or POINT intrinsic. The reason for
this is that the blitter is used to clear memory, and it alternates
cycles with the 68000, thus allowing the 68000 to run while memory is
being cleared. LINE and POINT also use the blitter. So for example if
LINE immediately follows CLEAR, the 68000 must spend its time waiting for
the blitter to finish clearing before giving it the LINE command. The
68000 could be spending this time doing something useful. It takes
approximately 1/90th of a second to clear a 640x400x1 bit-map.
41. POINT(X, Y, color)
This intrinsic draws a point on the current bit-map at the specified
coordinate, X,Y. (See 108. BITMAP.)
"Color" simply specifies whether or not a pixel in a particular bit plane
is set or cleared. If there is only one bit plane (DEPTH = 1) then color
can be either 0 or 1; if there are two bit planes (DEPTH = 2) then color
can be 0 through 3; etc. Here "color" is used to select a color register
-- the actual color that is displayed is determined by the value in the
color register (see 111. PALETTE).
Color bits 0 through 4 are used to specify up to 32 different color
registers. Bits 5 through 7 are reserved for future color registers.
Bit 8 is used to specify complement mode. If this bit is set, the
register select bits (0-7) and bit 9 are ignored. Instead, the color
register is determined by complementing the value that is already drawn.
For example, with a single bit plane a point that is 0 (the background
color) will be changed to a 1. If this point is redrawn then it will be
changed back to a 0. This provides a convenient way to "erase" a point by
redrawing it. The point will be restored to its original color, which
could be part of a complex background pattern.
Bit 9 specifies "fast" mode. Assume you have four bit planes (DEPTH = 4)
and you are drawing on a cleared bit-map. If you specify color = 8 then
one pixel is set and three pixels are cleared. But these were already
clear. By specifying color = $28, you save the time required to clear the
pixels. Actually, the time savings is negligible when drawing points, but
it is significant when drawing lines.
42. LINE(X, Y, color)
This intrinsic draws a straight line on the current bit-map. The line is
drawn from the previous coordinate to the coordinate X,Y. "Color" is the
same as for POINT, however bits 16 through 31 are used to specify various
patterns of dotted and dashed lines.
For example, this will draw a normal, solid line from 0,0 to 160,100:
POINT(0, 0, 0); \set the starting coordinate
LINE(160, 100, 1); \draw a solid line
This will continue drawing the line from 160,100 to the upper-right
corner, 319,0:
LINE(319, 0, 1);
This draws a dotted line down to the lower-left corner:
LINE(0, 200, $AAAA0001);
43. MOVE(X, Y)
This intrinsic is used to move to the beginning of a line.
108. BITMAP(address, width, height, depth)
This intrinsic defines the location in memory to be used for a bit-
mapped graphics display. The dimensions are specified in pixels. To set
up a typical low-resolution display using two bit planes (four colors),
do the following:
def WIDTH= 320, HEIGHT= 200, DEPTH= 2;
begin
RASTER:= RESERVE(WIDTH /8 *HEIGHT *DEPTH);
BITMAP(RASTER, WIDTH, HEIGHT, DEPTH);
\ . . .
109.
BITMAP2(magnificationX, magnificationY, offsetX, offsetY, invertX, invertY)
This intrinsic changes the way points and lines are plotted on the bit-
map. "Magnification" is used to enlarge or diminish coordinates along the
X or Y axes. The specified magnification is actually a power of two. For
example, if magnificationX = 1 then the X coordinate is doubled before it
is plotted. If magnificationX = 2 then the X coordinate is multiplied by
four. If magnificationY = -3 then the Y coordinate is divided by eight.
The default magnification is 0, which causes no change in size.
"Offset" is the amount that is added to a coordinate before it is
plotted. Normally the upper-left corner is the coordinate 0,0, but
sometimes it is convenient to use the center of the screen as the origin.
In this case, for a low resolution display, the X and Y offsets would be
160 and 100. Any offset can be specified. If a portion of your image is
outside the limits of the bit-map, it is automatically clipped. The
default offset is 0.
"Invert" is a boolean which is used to invert the direction of an axis.
For example, if you prefer to think of the Y axis as increasing from
bottom to top, set invertY = true. The default X direction is from left
to right (invertX = false). The default Y direction is from bottom to top
(invertY = false).
110. VIEW(address, BPLCON0)
This intrinsic is used to control the way a bit-map is displayed. Since
there can be more than one bit-map, the address is used to select which
one is to be displayed. The address can also specify which portion to
display if the bit-map is larger than the screen.
BPLCON0 is the value that is written into the Amiga's graphics control
register ($DFF100). The individual bits are defined as follows:
15 HIRES High resolution mode (WIDTH = 640)
14 BPU2 Bit plane use code (DEPTH = 0 through 6)
13 BPU1 " " " " " " "
12 BPU0 " " " " " " "
11 HAM Hold and modify mode (HIRES=0, BPU=5 or =6)
10 DBLPF Double playfield (PF1=odd, PF2=even bit planes)
9 COLOR Composit video color enable (no effect on RGB)
8 GAUD Genlock audio enable
7 -- Not used
6 -- " "
5 -- " "
4 -- " "
3 LPEN Light pen enable (reset on power-up)
2 LACE Interlace enable (HEIGHT = 400)
1 ERSY External resync
0 -- Not used
This is how you would display the RASTER bit-map defined above
(320 x 200 x 2):
VIEW(RASTER, $2000);
111. PALETTE(register, value)
This intrinsic is used to set the value of a color register. "Register"
is 0 through 31. "Value" is a 12-bit integer consisting of four bits of
red, green, and blue. For example:
Black $000 Gray $888
Red $F00 Orange $F90
Green $0F0 Yellow $FF0
Blue $00F Purple $91F
White $FFF Brown $C80
ck $000 Gray $888
Red $F00 Orange $F90
Green $0F0 Yellow $FF0
Blue $00